<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<div id="root">

</div>
<script>
    const root = document.getElementById('root');
    let student = {
        student_id: 1,
        id: 1001,
        name: "John",
        age: 20,
        gender: 'male',
        major: '软件工程',
        self_introduction: function () {
            return '大家好，我是' + this.major + '专业的' + this.name + '，今年' + this.age + '岁。';
        }
    }
    root.innerHTML = student.self_introduction()
</script>

</body>
</html>